﻿using System;
using System.Windows.Forms;
using System.Xml;

namespace TestProject
{
    class MyXmlDocument : XmlDocument
    {
        public void Increment(XmlAttribute attr)
        {
            attr.Value = (Convert.ToInt32(attr.Value) + 1).ToString();
        }
        public void Decrement(XmlAttribute attr)
        {
            attr.Value = (Convert.ToInt32(attr.Value) - 1).ToString();
        }
        public void Increment(XmlAttribute attr, int i)
        {
            attr.Value = (Convert.ToInt32(attr.Value) + i).ToString();
        }
        public void Decrement(XmlAttribute attr, int i)
        {
            attr.Value = (Convert.ToInt32(attr.Value) - i).ToString();
        }
    }
    class MyNUD : NumericUpDown
    {
        private bool incremented = false;
        private bool decremented = false;
        public int difference {set;get;}
        public override void UpButton()
        {
            base.UpButton();
            incremented = true;
            decremented = false;
            difference++;
        }
        public override void DownButton()
        {
            base.DownButton();
            decremented = true;
            incremented = false;
            difference++;
        }
        public bool IsIncremented()
        {
            if (incremented)
                return true;
            else
                return false;
        }
        public bool IsDecremented()
        {
            if (decremented)
                return true;
            else
                return false;
        }
        public MyNUD()
        {
            difference = 0;
        }
    }
}
